-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix frontend deprecations #10198
Fix frontend deprecations #10198
Conversation
c84b9f9
to
f6e066b
Compare
f6e066b
to
39651f8
Compare
39651f8
to
ae57cf5
Compare
This fixes deprecations: - Do not use A() on an EmberData PromiseManyArray
…h a task This fixes the following deprecations: - The get method on ember-data's PromiseManyArray is deprecated.
This fixes the following deprecations: - The toArray method on ember-data's PromiseManyArray is deprecated. - The `toArray` method on the class ManyArray is deprecated. by explicitly loading `owners` with a task.
This extracts functionality from `isOwner` as a more generic method. The data is loaded explicitly with `loadOwnerUserTask` to avoid deprecations. A debugging assert is also included to inform if perform() is not called before using it.
This fixes the following deprecations: - The findBy method on ember-data's PromiseManyArray is deprecated. - The `findBy` method on the class ManyArray is deprecated.
This fixes the following deprecations: - The removeObject method on ember-data's PromiseManyArray is deprecated. - The `removeObject` method on the class ManyArray is deprecated.
A debugging assert is also included to inform missing `perform()` called before accessing getters. This fix the following deprecations: - The toArray method on ember-data's PromiseManyArray is deprecated. - The `toArray` method on the class ManyArray is deprecated.
This fixes the following deprecations: - The `firstObject` method on the class ManyArray is deprecated.
ae57cf5
to
ac1a774
Compare
I made a small change https://github.com/rust-lang/crates.io/compare/39651f8a797c6277cc55a26b42229595baac19a5..ae57cf546017b6216cc550c4fb464946b0b263af#diff-8cda1e782838bbd82b901eae0eef8750eaae70e6685898e5f51ef474459a3374 |
let crate = this.modelFor('crate'); | ||
controller.set('crate', crate); | ||
// TODO: Add error handling | ||
waitForPromise(crate.loadVersionsTask.perform()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if it makes more sense to call this task in the model()
or at least afterModel()
hooks, so that the data is fully loaded before the route displays anything. I don't know why it was originally implemented this way.
I guess this is a non-blocking concern though, since the code previously used the same pattern 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although implementing it this way could potentially be more complex, it would also be more responsive, as it could display all other elements (layout, crate header) before the versions are ready (a loading indicator for this hasn't been implemented yet).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yeah, I mostly implemented it following the previous pattern. But I guess putting this either in model()
or afterModel()
should also work for non-blocking purposes, just note not to await for it.
This PR should hopefully fix the remaining deprecations :)